﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StateAgent.Miner
{
    public class IdleState : BaseState<Miner>
    {
        public override void Exit(Miner entity)
        {
        }

        public override void Execute(Miner entity)
        {
            entity.fatigue += RandomGenerator.Rand(5);

            if (entity.fatigue >= 80)
                entity.StateMachine.ChangeState(new SleepingState());
            else
            {
                if( RandomGenerator.Rand(100) < 50 )
                    entity.StateMachine.ChangeState(new WorkingState());
            }
        }

        public override void Enter(Miner entity)
        {
        }
    }
}
